<template>
	<view class="">
		<view class="content">
			<view class="topBg"></view>
			<view class="content_info">
				<!-- 活动具体信息 -->
				<detail-info :activityTitle="activityInfo.activityName"
					:activiyTime="activityInfo.timeStart+'至'+activityInfo.timeEnd" :finishTime="activityInfo.timeEnd">
					<view class="other-content" slot="other">
						已有{{activityInfo.number}}人报名
					</view>
				</detail-info>
				<!-- 活动门店 -->
				<view v-if="activityInfo.unitDto" style="margin-top: 20upx;">
					<home-title title="活动门店" type="2"></home-title>
					<view style="margin-bottom: 20upx;" v-for="(item, index) in activityInfo.unitDto" :key="index">
						<store-cell :isLocation="0" :storeName="item.storeName" :storeAddress="item.address"
							:distance="item.distance" :phone="item.contactPhone" :latitude="item.lat"
							:longitude="item.lon"></store-cell>
					</view>
				</view>
				<!-- 活动介绍 -->
				<detail-introduce :richInfo="activityInfo.collectContent"></detail-introduce>
			</view>

		</view>

	</view>
</template>

<script>
	import detailInfo from '@/components/activity/activity-detailInfo.vue'
	import detailIntroduce from '@/components/activity/activity-detailIntroduce.vue'
	import homeTitle from '@/components/activity/mmv-home-title.vue'
	import storeCell from '@/components/activity/store-cell.vue'
	import {
		apiCollectInfo
	} from '@/api/marketingB-helper.js'
	export default {
		components: {
			detailInfo,
			detailIntroduce,
			homeTitle,
			storeCell
		},
		data() {
			return {
				activityId: '',
				activityInfo: {},
			}
		},
		onLoad(op) {

			this.activityId = JSON.parse(op.param).bizNo;
			this.getData();
		},
		methods: {
			//获取详情数据
			getData() {
				apiCollectInfo({
					bizNo: this.activityId,
				}).then(res => {
					this.activityInfo = res.data;
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		&_info {
			padding: 0 30upx;
			position: relative;
			top: 40rpx;
		}
	}

	.bottomView {
		display: flex;
		width: 100%;
		height: 96upx;
		line-height: 96upx;
		position: fixed;
		bottom: 0;
		left: 0;
		z-index: 1;
	}

	.btn {
		width: 50%;
		line-height: 100%;
		font-size: 33upx;
		display: flex;
		justify-content: center;
		align-items: center;
		position: relative;
	}

	.leftBtn {
		color: #666;
		background-color: #FFFFFF;
		height: 96upx;
		line-height: 96upx;
		align-self: center;
		text-align: center;
	}

	.rightBtn {
		color: #fff;
		background-color: $main-color;
	}

	.other-content {
		font-size: 28upx;
		font-family: PingFang SC, PingFang SC-Bold;
		font-weight: bold;
		text-align: left;
		margin-top: 30upx;
		color: #ec4863;
	}
</style>
